//
function glist(){
	var len = document.form1.right.length;
	var list = "";
	if(form1.gname.value == ""){
		alert("用户组名称不能为空");
		return false;
	}
	
	for(var i = 0; i < len-1; i++){
		list += document.form1.right[i].text + ",";
	}
	list += document.form1.right[len-1].text;
	form1.g_list.value = list;
}

function glist1(){
	var len = document.form1.right.length;
	var list = "";
	
	for(var i = 0; i < len-1; i++){
		list += document.form1.right[i].text + ",";
	}
	list += document.form1.right[len-1].text;
	form1.g_list.value = list;
}

//移动select的部分内容,必须存在value，此函数以value为标准进行移动
function moveSelected(oSourceSel,oTargetSel)
{
     var arrSelValue = new Array();
     var arrSelText = new Array();
     var arrValueTextRelation = new Array();
     var index = 0;
     for(var i=0; i<oSourceSel.options.length; i++)
     {
         if(oSourceSel.options[i].selected)
         {

             arrSelValue[index] = oSourceSel.options[i].value;
             arrSelText[index] = oSourceSel.options[i].text;
             arrValueTextRelation[arrSelValue[index]] = oSourceSel.options[i];
             index ++;
         }
     }
     for(var i=0; i<arrSelText.length; i++)  
     {
         var oOption = document.createElement("option");
         oOption.text = arrSelText[i];
         oOption.value = arrSelValue[i];
         oTargetSel.add(oOption);
         oSourceSel.removeChild(arrValueTextRelation[arrSelValue[i]]);
     }
 }
